from django.conf.urls.defaults import patterns, include
import settings
from ssyblog.links.views import links
from ssyblog.admin.views import about

# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()

#static media
urlpatterns = patterns('',
    (r'^site_media/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.STATIC_PATH}),
    (r'^site_photos/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_ROOT}),
    (r'^diary_images/(?P<path>.*)$', 'django.views.static.serve',{'document_root': settings.MEDIA_DIARY_ROOT}),
)

#home page
urlpatterns += patterns('ssyblog.diary.views',
    (r'^$', 'home'),
    (r'^home/$', 'home'),
    (r'^content/(?P<diaryId>\d*)/$','content'),
    (r'^saveComment/$','saveComment'),
)

urlpatterns += patterns('',
    (r'^links/$', links),
    (r'^about/$', about),
    # Examples:
    # url(r'^$', 'ssyblog.views.home', name='home'),
    # url(r'^ssyblog/', include('ssyblog.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    # url(r'^admin/', include(admin.site.urls)),
)

# photos view
urlpatterns += patterns('ssyblog.photos.views',
    (r'^photos/$', 'photos'),
    (r'^loadPhotos/(?P<albumId>\d+)/(?P<page>\d+)/$', 'loadPhotos'),
)

#admin cms
urlpatterns += patterns('',
    (r'^admin/*',include('ssyblog.cms.urls')),
)
